package com.fun_ordering.controller;

import com.fun_ordering.components.ApiResponse;
import com.fun_ordering.util.OssUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 陈星
 * @date 2024/3/16 19:12
 */
@RestController
public class UploadController {

//    private OssUtil ossUtil;
    @PostMapping("/upload")
    public ApiResponse upload(MultipartFile file){
        String url = OssUtil.uploadFileToOss(file);
        System.out.println("url"+url);
        return ApiResponse.success(url);
    }
}
